/* -*- c++ -*- */

%feature("autodoc", "1"); // generate python docstrings

%include "exception.i"
%import "gnuradio.i" // the common stuff

%{
#include "gnuradio_swig_bug_workaround.h" // mandatory bug fix
#include "xstar_framer_sink.h"
#include "xstar_reed_solomon.h"
#include <stdexcept>
%}

GR_SWIG_BLOCK_MAGIC(xstar,framer_sink);

xstar_framer_sink_sptr 
xstar_make_framer_sink(gr_msg_queue_sptr target_queue);

class xstar_framer_sink : public gr_sync_block
{
 protected:
  xstar_framer_sink(gr_msg_queue_sptr target_queue);

 public:
  bool set_postamble(const std::string &postamble);
  ~xstar_framer_sink();
};

/* Hack; Magic from GR_SWIG_BLOCK_MAGIC */
class xstar_reed_solomon;
typedef boost::shared_ptr<xstar_reed_solomon> xstar_reed_solomon_sptr;
%template(xstar_reed_solomon_sptr) boost::shared_ptr<xstar_reed_solomon>;
%rename(reed_solomon) xstar_make_reed_solomon;

xstar_reed_solomon_sptr 
xstar_make_reed_solomon(int packet_size, int fec_size);

class xstar_reed_solomon
{
 protected:
  xstar_reed_solomon(int packet_size, int fec_size);

 public:
  std::string encode(char *packet);
  std::string decode(char *packet);
  ~xstar_reed_solomon();
};
